import Vue from 'vue'
import Vuex from 'vuex'
import {toast} from '@/common/js/public.js'
Vue.use(Vuex)

const store = new Vuex.Store({
	state: {
		userInfo:uni.getStorageSync('tutor_userInfo') || '', //微信信息
		customerCode:uni.getStorageSync('tutor_customerCode') || '', //家长编码
		appid:'wxd10aefdbccaf65fa', // 小程序appid
		openinfo:uni.getStorageSync('tutor_openinfo') || '', // 小程序openid unionid session_key
		position:uni.getStorageSync('tutor_position') || '' // 定位信息
	},
	mutations: {
		set_userInfo(state,val) {
			state.userInfo = val
		},
		set_customerCode(state,val) {
		  state.customerCode = val
		},
		set_position(state,val) {
			state.position = val
		},
		set_openinfo(state,val) {
			state.openinfo = val
		}
	},
	getters:{
		userInfo:state=>state.userInfo,
		customerCode: state => state.customerCode,
		appid: state => state.appid,
		position:state=>state.position,
		openinfo:state=>state.openinfo
	},
	actions:{
		
	}
})

export default store
